<template>
    <div>
        <el-table :data="stulist" height="625" style="width: 100%">
            <el-table-column type="selection" width="55" />
            <el-table-column prop="stuname" label="学生名称" width="180" />
            <el-table-column prop="tea" label="班主任" width="180" />
            <el-table-column prop="sex" label="性别" width="180" />
            <el-table-column prop="phone" label="联系电话" width="180" />
            <el-table-column prop="emcil" label="电子邮件" width="180" />
            <el-table-column prop="create_date" label="入学时间" />
            <el-table-column label="操作">
            <el-button>
                查看档案
            </el-button>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import { errmsg, get, sessmsg } from '../utils/request';

export default {
    data() {
        return {
            stulist: [],
        }
    },
    methods: {
        getStu() {
            get('http://127.0.0.1:5000/jiaoyu/stu')
            .then((resp) => {
                console.log(resp);
                if (resp.data.code==200) {
                    sessmsg(resp.data.msg)
                    this.stulist = resp.data.stu_list
                }
                else {
                    errmsg(resp.data.msg)
                }
            }).catch((err) => {
                console.log(err);
            });
        },

    },
    mounted() {
        this.getStu()
    }
}
</script>

<style>

</style>